Snack = function() {
   this.sid = -1;
   this.sName = "";
   this.price = 0;
   this.desc = "";
   this.stype = -1;
   this.points = 0;
}

Snack.prototype.setID = function(id) {
   this.sid = id;
}

Snack.prototype.getID = function() {
   return this.sid;
}

Snack.prototype.setName = function(name) {
   this.sName = name;
}

Snack.prototype.getName = function() {
   return this.sName;
}

Snack.prototype.setPrice = function(price) {
   this.price = price;
}

Snack.prototype.getPrice = function() {
   return this.price;
}

Snack.prototype.setDescription = function(desc) {
   this.sName = desc;
}

Snack.prototype.getDescription = function() {
   return this.desc;
}

Snack.prototype.setType = function(stype) {
   this.stype = stype;
}

Snack.prototype.getType = function() {
   return this.stype;
}

Snack.prototype.setPoints = function(pts) {
   this.points = pts;
}

Snack.prototype.getPoints = function() {
   return this.pts;
}

Snack.prototype.parseString = function(str) {
   var s = str.substring(8, str.length - 1);
   s = s.replace(/, /g, "&");
   this.sid = getValueFromURL(s, "id");
   this.sName = getValueFromURL(s, "name");
   this.price = getValueFromURL(s, "price");
   this.desc = getValueFromURL(s, "description");
   this.stype = getValueFromURL(s, "type");
   this.pts = getValueFromURL(s, "points");
}

Snack.prototype.toString = function() {
   return "Snack: {id=" + this.sid + ", name=" + this.sName +
      ", price=" + this.price + ", description=" + this.desc +
      ", type=" + this.stype + ", points=" + this.pts + "}";
}

Snack.prototype.parseBody = function(body) {

}

Snack.prototype.writeBody = function() {
}